package com.ccrfid.rmc6.resource.auth.pojo;

import java.security.Principal;
import java.util.List;

public class UserPrincipal implements Principal {
    private Long userId;
    private String userAccount;
    private String userName;
    private Integer cameraPermissionLevel;
    private List<Long> roles;
    private Long personnelId;
    private Long orgId;

    public UserPrincipal() {
    }

    public UserPrincipal(Long userId, String userAccount, String userName,
                         Integer cameraPermissionLevel, List<Long> roles, Long personnelId, Long orgId) {
        this.userId = userId;
        this.userAccount = userAccount;
        this.userName = userName;
        this.cameraPermissionLevel = cameraPermissionLevel;
        this.roles = roles;
        this.personnelId = personnelId;
        this.orgId = orgId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getCameraPermissionLevel() {
        return cameraPermissionLevel;
    }

    public void setCameraPermissionLevel(Integer cameraPermissionLevel) {
        this.cameraPermissionLevel = cameraPermissionLevel;
    }

    public List<Long> getRoles() {
        return roles;
    }

    public void setRoles(List<Long> roles) {
        this.roles = roles;
    }

    public Long getPersonnelId() {
        return personnelId;
    }

    public void setPersonnelId(Long personnelId) {
        this.personnelId = personnelId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    @Override
    public String getName() {
        return userAccount;
    }

    @Override
    public String toString() {
        return "UserPrincipal{" +
                "userId=" + userId +
                ", userAccount='" + userAccount + '\'' +
                ", userName='" + userName + '\'' +
                ", cameraPermissionLevel=" + cameraPermissionLevel +
                ", roles=" + roles +
                ", personnelId=" + personnelId +
                ", orgId=" + orgId +
                '}';
    }
}
